import { componentRegistry } from "./componentRegistry";
import {
  ElForm,
  ElFormItem,
  ElButton,
  ElCascader,
  ElCascaderPanel,
  ElCheckboxGroup,
  ElCheckbox,
  ElCheckboxButton,
  ElColorPicker,
  ElDatePicker,
  ElInput,
  ElInputNumber,
  ElRadioGroup,
  ElRadio,
  ElRadioButton,
  ElRate,
  ElSelect,
  ElOption,
  ElTimePicker,
  ElSlider,
  ElSwitch,
  ElTimeSelect,
  ElTransfer,
  ElUpload,
} from "element-plus";

// 注册主表单组件
componentRegistry.registerBatch([
  { type: "el-form", component: ElForm },
  { type: "el-form-item", component: ElFormItem },
  { type: "el-button", component: ElButton },
  { type: "el-cascader", component: ElCascader },
  { type: "el-cascader-panel", component: ElCascaderPanel },
  { type: "el-checkbox-group", component: ElCheckboxGroup },
  { type: "el-color-picker", component: ElColorPicker },
  { type: "el-date-picker", component: ElDatePicker },
  { type: "el-input", component: ElInput },
  { type: "el-input-number", component: ElInputNumber },
  { type: "el-radio-group", component: ElRadioGroup },
  { type: "el-rate", component: ElRate },
  { type: "el-select", component: ElSelect },
  { type: "el-time-picker", component: ElTimePicker },
  { type: "el-slider", component: ElSlider },
  { type: "el-switch", component: ElSwitch },
  { type: "el-time-select", component: ElTimeSelect },
  { type: "el-transfer", component: ElTransfer },
  { type: "el-upload", component: ElUpload },
]);

// 注册子组件 - 修复语法错误
componentRegistry.registerBatch([
  { type: "el-checkbox", component: ElCheckbox, isChildComponent: true },
  {
    type: "el-checkbox-button",
    component: ElCheckboxButton,
    isChildComponent: true,
  },
  { type: "el-radio", component: ElRadio, isChildComponent: true },
  { type: "el-radio-button", component: ElRadioButton, isChildComponent: true },
  { type: "el-option", component: ElOption, isChildComponent: true },
]);

// 注册特殊类型
export const SPECIAL_TYPES = {
  slot: "slot",
} as const;
